<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <base href="<%=basePath%>">
  <meta charset="UTF-8">
  <title>登录-walnut商场</title>
  <style>
    body, html {
      height: 100%;
      margin: 0;
      font-family: Arial, sans-serif;
    }
    body {
      background-image: url('image/back.png');
      background-size: cover;
      background-position: center;
      display: flex;
      justify-content: flex-end; /* 靠右对齐 */
      align-items: center;
    }
    .container {
      background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      width: 300px;
      margin-right: 50px; /* 右边距 */
      text-align: center;
    }
    h1 {
      color: #333;
      margin-bottom: 20px;
    }
    label {
      display: block;
      margin-bottom: 5px;
      color: #666;
      font-size: 14px;
    }
    input[type="text"],
    input[type="password"] {
      width: calc(100% - 22px); /* 减去padding的宽度 */
      padding: 10px;
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }
    input[type="submit"] {
      background-color: #007BFF;
      color: white;
      border: none;
      padding: 10px 20px;
      cursor: pointer;
      border-radius: 4px;
      transition: background-color 0.3s ease;
    }
    input[type="submit"]:hover {
      background-color: #0056b3;
    }
    a {
      color: #007BFF;
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
<div class="container">
  <h1>登录</h1>
  <form action="login" method="post">
    <label for="username">账号</label>
    <input type="text" id="username" name="username" required />
    <br>
    <label for="password">密码</label>
    <input type="password" id="password" name="password" required />
    <br>
    <input type="submit" value="登录" />
  </form>
  <p>没有账号？<a href="register.jsp">注册账号</a></p>
</div>
</body>
</html>
